package myky.com.doctorapp.presenter

import io.reactivex.disposables.Disposable
import myky.com.doctorapp.base.BasePresenterIm
import myky.com.doctorapp.base.RxSubscribe
import myky.com.doctorapp.contract.FollowRecordListContract
import myky.com.doctorapp.entity.FollowRecordEntity
import myky.com.doctorapp.model.FollowRecordListModel

/**
 * Description:
 *
 * @author wuyangwuyang
 * Created by 2019/3/19 on 17:38
 */
class FollowRecordListPresenter :BasePresenterIm<FollowRecordListContract.View>(), FollowRecordListContract.Presenter {

    var followDoctorListModel=FollowRecordListModel()
    override fun pgetFollowRecordList(current: Int,doctorId:Int) {
        followDoctorListModel.getFollowRecordList(current,doctorId).subscribe(object :RxSubscribe<FollowRecordEntity.DataBean>(){
            override fun onSuccess(t: FollowRecordEntity.DataBean) {

                mView.showContentView()
                mView.showDataSuccess(t)
            }

            override fun onFailed(code: Int, msg: String?) {
                mView.showNetErrorView()
            }

            override fun onSubscribe(d: Disposable) {

                addSubscription(d)
            }

        })
    }
}
